Release 10.1A: OpenEdge Development:
Progress 4GL Reference
CALL object handle
A handle to a CALL object, which lets you do the following dynamically:
Syntax
call-object-handleA handle to a CALL object.
attributeAn attribute of the CALL object.
methodA method of the CALL object. The methods let you set parameters, reset attributes to their default values, and invoke the CALL object.
Attributes
Methods
Examples
The following fragment dynamically invokes an external procedure nonpersistently:
The following fragment dynamically invokes an external procedure persistently, then dynamically invokes one of its internal procedures:
The following fragment uses a single CALL object handle multiple times:
The following fragment gets an attribute:
The following fragment sets an attribute:
The following fragment drives the INVOKE() from a TEMP-TABLE:
Notes
- Invoking logic dynamically requires many more lines of code than does invoking it statically, which can make your program hard to read. For this reason, Progress Software Corporation recommends that you invoke logic dynamically only when absolutely necessary. Specifically, use the CALL object only when you cannot use the RUN statement, the DYNAMIC-FUNCTION() function, or
widget:attributeorwidget:methodsyntax, as in the following situations:
Note: But if only the name of the procedure is unknown at compile time, use the RUN statement with the VALUE option—and avoid the CALL object altoghether.- To invoke an internal or external procedure whose calling sequence (number of parameters and the data type of each) is unknown at compile time.
Note: But if only the name of the function is unknown at compile time, use the DYNAMIC-FUNCTION() function—and avoid the CALL object altogether.- To invoke a function whose calling sequence is unknown at compile time.
- To reference a widget attribute or method whose name is unknown at compile time.
If you already know the name of the attribute or procedure, you know its syntax, since the name implies certain syntax. And if you know the syntax, you know the calling sequence, since the syntax defines the calling sequence. And if you know the calling sequence, you can use
widget:attributeorwidget:methodsyntax—and avoid the CALL object altogether.- To create a CALL object, use the following syntax:
For example:
Note: Unlike most 4GL objects, the CALL object, by default, goes into the SESSION widget pool, not into the closest unnamed widget pool.
- To delete a CALL object, use the following syntax:
For example:
Since the CALL object, by default, goes into the SESSION widget pool, not into the closest unnamed widget pool, to delete a CALL object created when the IN widget-pool option is not used, use the DELETE
objecthandlesyntax explicitly.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |